package com.mapull.entity;

/**
 * @author: mapull
 * @description: ProductEnum
 * @date:2020/03/21
 **/
public enum ProductEnum {
    BOOK("书籍"),
    FOOD("食物"),
    OTHER("其他");

    private String type;

    ProductEnum(String type) {
        this.type = type;
    }

    public String getType(){
        return type;
    }

    public static ProductEnum fromType(String type){
        for(ProductEnum typeEnum: values()){
            if(typeEnum.type.equals(type)){
                return typeEnum;
            }
        }
        return null;
    }
}
